Skip to content

IntelLLVM support extended#133

Merged
cpaolini merged 1 commit intomasterfrom
libmkl-fixed
May 16, 2025
Merged

IntelLLVM support extended#133
cpaolini merged 1 commit intomasterfrom
libmkl-fixed

Conversation

@JananiPSrinivasan
Copy link
Copy Markdown
Collaborator

What type of PR is this? (check all applicable)

  • Refactor
  • Feature
  • Bug Fix
  • Optimization
  • Example
  • Documentation

Description

Issue:

A user encountered a linker warning during the build:

/usr/bin/ld: warning: libmkl_rt.so.2, needed by libarmadillo.so, not found

This occurred because Armadillo had been linked against Intel MKL, but the MKL runtime (libmkl_rt.so) was not discoverable by the system at runtime. The issue was only resolved when the user manually sourced the Intel oneAPI environment, allowing the linker to find the required MKL libraries.

Resolution:

The CMakeLists.txt was updated to:

  • Automatically detect if the Intel oneAPI icpx compiler (CMAKE_CXX_COMPILER_ID == IntelLLVM) is being used.

  • If detected:

    • Retrieve MKLROOT from the environment or fallback to a default path.

    • Set BLAS and LAPACK paths to point to MKL.

    • Configure Armadillo to link against MKL without requiring user input.

Related Issues & Documents

QA Instructions, Screenshots, Recordings

To test the updated CMake configuration with Intel oneAPI compilers, ensure you have the Intel oneAPI toolkit installed and the environment sourced

. /opt/intel/oneapi/setvars.sh

Then,

mkdir build && cd build
cmake .. -DCMAKE_CXX_COMPILER=icpx
make -j

The output file will have the following lines


oneapi@oneapi-Precision-5820-Tower:~/mole/build$ cmake .. -DCMAKE_CXX_COMPILER=icpx
-- The CXX compiler identification is IntelLLVM 2025.1.1
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /opt/intel/oneapi/compiler/2025.1/bin/icpx - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Detected CXX Compiler ID: IntelLLVM
-- Using non-Clang compiler flags.
-- Using MKL from: /opt/intel/oneapi/mkl/2025.1
-- SuperLU CMakeLists.txt after patch: cmake_minimum_required(VERSION 3.10)

Added/updated tests?

  • We encourage you to test all code included with MOLE, including examples.

  • Yes

  • No, and this is why: please replace this line with details on why tests
    have not been included

  • I need help with writing tests

Read Contributing Guide and Code of Conduct

Copy link
Copy Markdown
Collaborator

@cpaolini cpaolini left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approve CMake support added for Intel® oneAPI Base Toolkit.

@cpaolini cpaolini merged commit e12b984 into master May 16, 2025
8 checks passed
@cpaolini cpaolini deleted the libmkl-fixed branch May 16, 2025 16:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MOLE installation

2 participants